#ifndef SCALEWHEELEATER_H
#define SCALEWHEELEATER_H

#include <QWidget>
#include <functional>

typedef std::function<void(QWheelEvent *event, QSize before, QSize after)> ScaleWheelEaterFunc;

class ScaleWheelEater : public QObject
{
    Q_OBJECT
public:
    explicit ScaleWheelEater(QWidget *parent, QWidget *target = nullptr, ScaleWheelEaterFunc func_before = nullptr, ScaleWheelEaterFunc func_after = nullptr, std::function<void()> finally = nullptr);
    void setRatio(int ratio = 100);

private:
    QWidget *m_parent;
    QWidget *m_target;
    ScaleWheelEaterFunc m_func_before;
    ScaleWheelEaterFunc m_func_after;
    std::function<void()> m_finally;

    int m_ratio;
};

#endif // SCALEWHEELEATER_H
